import request from '@/utils/request'
import { renderUrl } from '../../utils'

const headers = {
  'Content-Type': 'application/json'
}

export function add(data) {
  return request({
    url: '/admin/permission/create',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export function del(data) {
  return request({
    url: '/admin/permission/delete',
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: '/admin/permission/update',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export function treeList() {
  return request({
    url: '/admin/privilege/getAllPrivileges',
    method: 'post',
    headers
  })
}

export default { add, edit, del }

